package com.ruoyi.business.domain.vo;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.business.domain.Plain;
import com.ruoyi.business.domain.User;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 锻炼对象 exercise
 *
 * @author 吴倩芸
 * @date 2023-03-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ExerciseVo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 计划id
     */
    @Excel(name = "计划id")
    private Long plainId;

    private Plain plain;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    private User user;

    /**
     * 签到时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签到时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 签退时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签退时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

    /**
     * 星期几
     */
    @Excel(name = "星期几")
    private String weekday;


    public String getStartTime() {
        if (null != startTime) {
            return sdf.format(startTime);
        }
        return "";
    }

    public String getEndTime() {
        if (null != endTime) {
            return sdf.format(endTime);
        }
        return "";
    }

}
